#include "sys.h"
#include "time.h"

/**
 * Returns the current time.
 *
 * @param time_t * t the timestamp pointer, if not used, keep NULL.
 *
 * @return time_t return timestamp current.
 *
 */
time_t time(time_t *t)
{
	time_t time_now = 0;

	extern time_t get_rtc_timestamp();
	time_now = get_rtc_timestamp();

	/* if t is not NULL, write timestamp to *t */
	if (t != NULL)
	{
		*t = time_now;
	}

	return time_now;
}

